package com.warm.orm.domain.sys;

import com.easy.query.core.annotation.Column;
import com.easy.query.core.annotation.ColumnIgnore;
import com.easy.query.core.annotation.EntityProxy;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.proxy.ProxyEntityAvailable;
import com.warm.core.annotation.Excel;
import com.warm.orm.domain.BaseEntity;
import com.warm.orm.domain.sys.proxy.SysPostProxy;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.noear.solon.validation.annotation.Length;
import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.NotNull;

import java.io.Serial;


/**
 * 岗位表 sys_post
 *
 * @author warm
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table("sys_post")
@EntityProxy
public class SysPost extends BaseEntity implements ProxyEntityAvailable<SysPost, SysPostProxy> {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 岗位序号
     */
    @Excel(name = "岗位序号" , cellType = Excel.ColumnType.NUMERIC)
    @Column(primaryKey = true, increment = true)
    private Long postId;

    private String tenantId;

    /**
     * 岗位编码
     */
    @Excel(name = "岗位编码")
    @NotBlank(message = "岗位编码不能为空")
    @Length(max = 64, message = "岗位编码长度不能超过64个字符")
    private String postCode;

    /**
     * 岗位名称
     */
    @Excel(name = "岗位名称")
    @NotBlank(message = "岗位名称不能为空")
    @Length(max = 50, message = "岗位名称长度不能超过50个字符")
    private String postName;

    /**
     * 岗位排序
     */
    @Excel(name = "岗位排序")
    @NotNull(message = "显示顺序不能为空")
    private Integer postSort;

    /**
     * 状态（0正常 1停用）
     */
    @Excel(name = "状态" , readConverterExp = "0=正常,1=停用")
    private String status;

    /**
     * 用户是否存在此岗位标识 默认不存在
     */
    @ColumnIgnore
    private boolean flag = false;

    /**
     * 备注
     */
    private String remark;

    @Override
    public Class<SysPostProxy> proxyTableClass() {
        return SysPostProxy.class;
    }
}
